//
//  TujiaAlertBasicView.swift
//  tttt
//
//  Created by Charles on 14-10-12.
//  Copyright (c) 2014年 Charles. All rights reserved.
//

import UIKit

open class TujiaAlertBasicView: UIView {
    weak var alertDelegate: TujiaAlertDelegate?

    var userTag: Int = 0
    /*
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func drawRect(rect: CGRect)
    {
        // Drawing code
    }
    */

    override open func awakeFromNib() {
        super.awakeFromNib()
        self.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height)
        //self.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.7)
    }
    
    public func show() {
        let win = UIApplication.shared.windows.last
        win?.addSubview(self)
    }
    
    public func remove() {
        self.removeFromSuperview()
    }
}

public protocol TujiaAlertDelegate: class {
    func alertViewClicked(_ sender: TujiaAlertBasicView, buttonIndex: Int, userTag: Int)
}
